{% block head %}
	<link href="{{ path }}js/plugins/datatables/DT_bootstrap.css" rel="stylesheet">
	<link href="{{ path }}js/plugins/responsive-tables/responsive-tables.css" rel="stylesheet"> 
    
    <script src="{{ path }}js/demos/demo.tables.js"></script>
    <script src="{{ path }}js/plugins/datatables/jquery.dataTables.js"></script>
    <script src="{{ path }}js/plugins/datatables/DT_bootstrap.js"></script>
	<script src="{{ path }}js/plugins/responsive-tables/responsive-tables.js"></script>
	
{% endblock %}

{% load humanize %}
	
	<div class="widget">	
		
        <div class="widget widget-table">                            
            <div class="widget-header">
                <h3>
                    <i class="icon-th-list"></i>
                    Inventario
                </h3>
            </div> <!-- /widget-header -->
            <div class="widget-content">
                <table class="table table-striped table-bordered table-highlight" id="example">
					<thead>
					<tr>
						<th width="10%" align="center">Código o Cum</th>
						<th width="20%" align="center">Nombre</th>
						<th width="8%" align="center">Lote</th>
						<th width="8%" align="center">No. Factura</th>
						<th width="15%" align="center">Categoria</th>
						<th width="10%" align="center">Sede</th>
						<th width="5%" align="center">Cant.</th>
						<th width="8%" align="center">V. compra</th>
						<th width="8%" align="center">V. venta</th>
						<th width="9%" align="center">F. Vencimiento</th>
					</tr>
					</thead>
					<tbody>
					
					{% for inv in Inventarios %}
						<tr class="{% cycle '' 'odd' %}">
							<td align="right"><input type="hidden" value="{{ inv.id }}"/><label>{{ inv.item.producto.cum }}</label></td>
							<td align="left"><label>{{ inv.item.producto.nombre }}</label></td>
							<td width="8%" align="right"><label>{{ inv.item.lote }}</label></td>
							<td width="8%" align="right"><label>{{ inv.item.factura_compra.numero }}</label></td>
							<td width="15%" align="center"><label title="{{ inv.item.producto.categoria }}">{{ inv.item.producto.categoria }}</label></td>
							<td width="10%" align="center"><label>{{ inv.sede.nombre }}</label></td>
							<td align="center"><label>{{ inv.cantidad }}</label></td>
							<td width="8%"><label>{{ inv.item.valor_unitario|default_if_none:0|intcomma }}</label></td>
							<td width="8%"><label>{{ inv.item.valor_venta|default_if_none:0|intcomma }}</label></td>
							<td width="9%" align="center"><label>{{ inv.item.fecha_vencimiento|date:'d-m-Y' }}</label></td>
						</tr>
					{% endfor %}
					</tbody>
				</table>
            </div> <!-- /. widget-content -->
        </div> <!-- /. widget-table -->
	</div> <!-- /. widget -->